`define ALUSLL 4'd7
`define ALUSLL16 4'd6
`define ALUXOR 4'd5
`define ALUOR 4'd4
`define ALUAND 4'd3
`define ALUSUB 4'd2
`define ALUADD 4'd1
`define ALUnone 4'd0
module ALU(
        input [31:0] a,
        input [31:0] b,
        input [4:0] shamt,
        input [3:0] ALU_operation,
        output [31:0] ALU_result
    );
    assign ALU_result=(ALU_operation==`ALUnone)?32'd0:
           (ALU_operation==`ALUADD)?a+b:
           (ALU_operation==`ALUSUB)?a-b:
           (ALU_operation==`ALUAND)?a&b:
           (ALU_operation==`ALUOR)?a|b:
           (ALU_operation==`ALUXOR)?a^b:
           (ALU_operation==`ALUSLL16)?b<<16:
           (ALU_operation==`ALUSLL)?b<<shamt:
           32'd0;
endmodule
